<?php
namespace App\Http\Controllers\Admin;
use App\Models\Admins;
use App\Models\Menu;

/**
 * IndexController.php
 * @author LF
 * @Date 16/7/4 11:50
 * @copyright Copyright© 2016-2016 飞煌科技
 * All Rights Reserved.
 * Code is poetry, thus is life.
 * @author JeffMing
 */
Class IndexController extends BaseController{
    public function __construct(Admins $admins, Menu $menu)
    {
        parent::__construct();
        $this->admin = $admins;
        $this->menu = $menu;
    }

    /**
     * 进入后台首页
     */
    public function getIndex(){
        $info = getSysBasicInfo();
        $admin = session('admin');
        $url = urlAdmin('login','getLogout');
        $menus = $this->menu->getMenuTree();
        debug($menus);
        return view('admin.index',compact('admin', 'info','menus'));
//        return view('admin.index2',compact('admin', 'info','menus'));
    }
    
    public function getTest()
    {
        return view('admin.test');
    }
}